<?php

namespace common\models\myhtsq;

use common\models\BaseModel;

/**
 * Description of RevenueRecognitionModel
 * 收入确认统一model
 * @author zhoud01
 */
class RevenueRecognitionModel extends BaseModel {

    public $recognition_id;
    public $revenue_id;
    public $contract_id;
    public $recognition_amount;
    public $last_period_total_confirm_amount;
    public $this_period_confirm_total_amount;
    public $recognition_begin;
    public $recognition_end;
    public $recognition_by;
    public $recognition_date;
    public $recognitioner_guid;
    public $created_by;
    public $created_on;
    public $modified_by;
    public $modified_on;
    public $is_del;

    public $recognition_type;
    public $contract_is_cancelled;
    public $contract_status;
    public $isCancelled;
    public $contractStatus;
    public $pageIndex;
    public $pageSize;
    public $close_status;
    public $search_key;
    public $type;
    public $beginDate;
    public $endDate;
    public $closeStatus;
    public $searchKey;

    public function __construct($config = array()) {
        parent::__construct($config);
    }

    public function rules() {
        return [
            //查询收入信息
            [['recognition_begin','recognition_end','contract_is_cancelled','contract_status','pageIndex','pageSize','close_status','search_key'],'string','on' => 'selectRevenueRecognition'],
            [['pageSize'],'default', 'value' => 20,'on' => 'selectRevenueRecognition'],
            //查询收入&回款&应收
            [['recognition_begin','recognition_end'],'string','on' => 'selectRevenueReceivablePayment'],
            //增加收入确认信息
            [['recognition_id', 'revenue_id', 'contract_id', 'created_by', 'modified_by'], 'string', 'max' => 36, 'on' => 'saveRevenueRecognition'],
            [['is_del'],'number','on' => 'saveRevenueRecognition'],
            [['recognition_type'],'string','on' => 'saveRevenueRecognition'],
            [['is_del'],'default', 'value' => 1,'on' => 'saveRevenueRecognition'],
            //结转期间设置
            [['recognition_begin','recognition_end'],'required','on' => 'saveRevenueRecognitionDate'],
            [['is_del'],'default', 'value' => 1,'on' => 'saveRevenueRecognitionDate'],
            //查询收入结转记录
            [['revenue_id'],'string','max' => 36,'on' => 'selectRecognitionByRevenueId'],
            //删除收入
            [['revenue_id'],'string','max' => 36,'on' => 'delRevenueByRevenueId'],
            //修改确认收入
            [['recognition_id'],'string','max' => 36,'on' => 'updateRecognitionByRevenueId'],
            [['recognition_amount'],'string','on' => 'updateRecognitionByRevenueId'],
            //导出待确认收入
            [['contractStatus','isCancelled','recognition_begin','recognition_end','contract_is_cancelled','contract_status','pageIndex','pageSize','closeStatus','search_key','searchKey','type' ,'beginDate' ,'endDate'],'string','on' => 'exportRevenue'],
        ];
    }

}
